#ifndef __BIN_TREE_H
#define __BIN_TREE_H

typedef struct _tree_node TreeNode;
typedef struct _tree Tree;

Tree *tree_new();
void tree_empty(Tree *tree);
void tree_free(Tree *t);

int tree_insert(Tree *tree, void *data);
void tree_preorder(Tree *tree, void (*visit)(Tree *, TreeNode *));
void tree_inorder(Tree *tree, void (*visit)(Tree *, TreeNode *));
void tree_postorder(Tree *tree, void (*visit)(Tree *, TreeNode *));
void tree_level_order(Tree *tree, void (*visit)(Tree *, TreeNode *));

#endif